﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using Ultility;
using System.Data;
using System.Data.SqlClient;

namespace Entity
{
    public partial class Entity_Statistics : Component
    {
        DBAccess _access = new DBAccess();
        public Entity_Statistics()
        {
            InitializeComponent();
        }

        public Entity_Statistics(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
        }
        public DataSet _Thongke_DoanhThu_Ngay(int ngay, int thang, int nam)
        {
            SqlParameter[] para = {   new SqlParameter("@day",SqlDbType.Int),
                                      new SqlParameter("@month",SqlDbType.Int),
                                      new SqlParameter("@year",SqlDbType.Int),
                                   };
            para[0].Value = ngay;
            para[1].Value = thang;
            para[2].Value = nam;
            return _access._ExcuteQuery("sp_ThongkeDoanhThuNgay", para);
        }

        public DataSet _Thongke_DoanhThu_Thang(int thang, int nam)
        {
               SqlParameter[] para = {new SqlParameter("@month",SqlDbType.Int),
                                      new SqlParameter("@year",SqlDbType.Int),    
                                    };
               para[0].Value = thang;
               para[1].Value = nam;
               return _access._ExcuteQuery("sp_ThongkeDoanhThuThang", para);
        }

        public DataSet _TK_Sophong_theoNgay(int ngay, int thang, int nam)
        {
            SqlParameter[] para = { new SqlParameter("@day",SqlDbType.Int),
                                    new SqlParameter("@month",SqlDbType.Int),
                                    new SqlParameter("@year",SqlDbType.Int),                                  
                                  };
            para[0].Value = ngay;
            para[1].Value = thang;
            para[2].Value = nam;
            return _access._ExcuteQuery("sp_TK_tinhtrangPhong", para);
        }
    }
}
